package com.four.collage.controller;


import com.four.collage.entity.Attribute;
import com.four.collage.service.IAttributeService;
import com.guli.common.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author gs
 * @since 2021-12-18
 */
@RestController
@RequestMapping("/attribute")
public class AttributeController {

    @Autowired
    private IAttributeService attributeService;

    /**
     * 根据拼团商品id查询属性
     * @param grId
     * @return
     */
    @GetMapping("/getAttribute/{grId}")
    public R getAttribute(@PathVariable("grId")Integer grId){
        Attribute attribute=attributeService.getAttribute(grId);
        return R.ok().put("attribute",attribute);
    }

}
